package platform

import (
	"supervideo/app/models"
	"supervideo/pkg/database"
)

type Platform struct {
	models.BaseModel

	Title  string `json:"title"`
	Sort   int8   `json:"sort,omitempty"`
	Status int8   `json:"status,omitempty"`
	Remark string `json:"remark"`

	models.CommonTimestampsField
}

func (platform *Platform) Create() {
	database.DB.Create(&platform)
}

func (platform *Platform) Save() (rowAffected int64) {
	result := database.DB.Save(&platform)
	return result.RowsAffected
}

func (platform *Platform) Delete() (rowAffected int64) {
	result := database.DB.Delete(&platform)
	return result.RowsAffected
}
